package com.dreamcar.auction.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * DreamcarEmployee entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "dreamcar_employee", catalog = "assignment")
public class DreamcarEmployee implements java.io.Serializable {

	// Fields

	private Integer idDreamcarEmployee;
	private String username;
	private String password;
	private String name;
	private Set<Request> requests = new HashSet<Request>(0);

	// Constructors

	/** default constructor */
	public DreamcarEmployee() {
	}

	/** minimal constructor */
	public DreamcarEmployee(Integer idDreamcarEmployee) {
		this.idDreamcarEmployee = idDreamcarEmployee;
	}

	/** full constructor */
	public DreamcarEmployee(Integer idDreamcarEmployee, String username,
			String password, String name, Set<Request> requests) {
		this.idDreamcarEmployee = idDreamcarEmployee;
		this.username = username;
		this.password = password;
		this.name = name;
		this.requests = requests;
	}

	// Property accessors
	@Id
	@Column(name = "ID_DREAMCAR_EMPLOYEE", unique = true, nullable = false)
	public Integer getIdDreamcarEmployee() {
		return this.idDreamcarEmployee;
	}

	public void setIdDreamcarEmployee(Integer idDreamcarEmployee) {
		this.idDreamcarEmployee = idDreamcarEmployee;
	}

	@Column(name = "USERNAME", length = 45)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "PASSWORD", length = 45)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "NAME", length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dreamcarEmployee")
	public Set<Request> getRequests() {
		return this.requests;
	}

	public void setRequests(Set<Request> requests) {
		this.requests = requests;
	}

}